home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 1
/
Precision Software Applications Silver Collection Volume One (PSM) (1993).iso
/
tutor
/
modula12.exe
/
RECURSON.MOD
< prev
next >
Wrap
Text File
|
1988-10-26
|
507b
|
23 lines
(* Chapter 5 - Program 7 *)
MODULE Recurson;
FROM InOut IMPORT WriteString, WriteInt, WriteLn;
VAR Count : INTEGER;
PROCEDURE PrintAndDecrement(Index : INTEGER);
BEGIN
WriteString("The value of the Index is");
WriteInt(Index,5);
WriteLn;
Index := Index - 1;
IF Index > 0 THEN
PrintAndDecrement(Index);
END;
END PrintAndDecrement;
BEGIN (* Main program *)
Count := 7;
PrintAndDecrement(Count);
END Recurson.